import datetime
from google.appengine.ext import db
from google.appengine.api import users
from google.appengine.ext import webapp

from volunteer import *
# from non_profit import *
# from group import *

class LocalUser(db.Model):
    usertype = db.UserProperty()

class NewLocalUser(webapp.RequestHander):
    def get(self):
      self.response.out.write("<html><body>")
      self.response.out.write('<form action="POST">')
      self.response.out.write('<input type="radio" name="login_type" value="volunteer" />Volunteer<br />')
      self.response.out.write('<input type="radio" name="login_type" value="nonprofit" />Non-profit<br />')
      self.response.out.write('</form>')
      self.response.out.write('</body></html>')


class Volunteer(db.Model):
    fname = db.StringProperty(required=True)
    lname = db.StringProperty(required=True)
    email = db.EmailProperty(required=True)
    phone = db.ReferenceProperty(PhoneContact)
    start_date = db.DateTimeProperty(required=True)
    end_date = db.DateTimeProperty(required=True)

class ListVolunteer(webapp.RequestHandler):
    def get(self):
        self.response.out.write('<html><body>')
        volunteers = db.GqlQuery("SELECT * from Volunteer LIMIT 10")

        for v in volunteers:
          self.response.out.write("<div><b>%s, %s</b>" % (v.lname, v.lname))
        self.response.out.write('</body></html>')

class NewVolunteer(webapp.RequestHandler):
    def post(self):
        self.response.out.write("<html><body></body></html>")
